UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MGfHhKKdiBQFas8Ts9RwJhdBalg3xozEf61qiQ5fzjI='
WHERE
key_id = '557d69514151cfda74c43c1e39fdb1846a44d7aa79c192a91c16d0788d52306c'
AND (
token = 'MGfHhKKdiBQFas8Ts9RwJhdBalg3xozEf61qiQ5fzjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)