UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yejJCY5pS/Ij1NdY/QZymdPoyckftHiZYGLthsGtg6E='
WHERE
key_id = '79eded615474d9540c000baae0d6b76b898758a51cae66c9d3460e4b0d1b1c1d'
AND (
token = 'yejJCY5pS/Ij1NdY/QZymdPoyckftHiZYGLthsGtg6E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)