UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sewL9NWkDY+Fb+Q/wNzEXvtmDTOzFFl1DxlePY/xAyo='
WHERE
key_id = '5c369de5bb068e7298759e216e4f9604f496671a6cb7f76141fd7a52f7c5cc8d'
AND (
token = 'sewL9NWkDY+Fb+Q/wNzEXvtmDTOzFFl1DxlePY/xAyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)