UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4JF/TXUOY+h3CNC1ibI7eT2WJKa+6g2XmqqS4TFVSog='
WHERE
key_id = '187eee9ef1c91bbf111b0060ba31f637045c6a5632583fd2308380f62ce0b053'
AND (
token = '4JF/TXUOY+h3CNC1ibI7eT2WJKa+6g2XmqqS4TFVSog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)