UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '64P4DITWkMy7R8Z5CPFQNWR8iuEInkJw+lFnuNRCFLk='
WHERE
key_id = '2ae53b5b2b2b1ed0c84ef3c8090b0b0f75cc8d4bec9743ced0db1a7dab7311ad'
AND (
token = '64P4DITWkMy7R8Z5CPFQNWR8iuEInkJw+lFnuNRCFLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)