UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mo/v3/TqMXT2KqYVF/qMgODaAhzp0MsAVnnJQcvikIU=' 
WHERE 
  key_id = '37c867f83e9fd54e91bc6f4235a5b2d2a5543677bd1d3add95a09e57baf9471a' 
  AND (
    token = 'mo/v3/TqMXT2KqYVF/qMgODaAhzp0MsAVnnJQcvikIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033