UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K47xTr549EymAG/BNcsPr5Mx2rDXY6aiz8kN3ipcaEs='
WHERE
key_id = 'aadc17c0d9d5061fc7726fa6e4b3e7c9ddcc33e65bc401fa6b179dd23ad4e5b3'
AND (
token = 'K47xTr549EymAG/BNcsPr5Mx2rDXY6aiz8kN3ipcaEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)