UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mea/O4XUdqdcmnqyRQaEOZL3nUsk0VJ75MiMS6w6sCc='
WHERE
key_id = '15e79797afac0737a459cf5883e8c5a611d58a21a24c6f29167abeeb8101c908'
AND (
token = 'mea/O4XUdqdcmnqyRQaEOZL3nUsk0VJ75MiMS6w6sCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)