UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lq3pLnjdTbl2AvAer+7qzxK/QSs5mRjujBLgwAOgavY='
WHERE
key_id = '0828408fe6596329cc752e574ab61968b187837b8666290578460953b508ee79'
AND (
token = 'Lq3pLnjdTbl2AvAer+7qzxK/QSs5mRjujBLgwAOgavY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)